package com.zpc.rabbitmq.mqcallback;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.core.RabbitTemplate;

public class MsgSendReturnCallback implements RabbitTemplate.ReturnCallback{
	private static final Logger logger = LoggerFactory.getLogger(MsgSendConfirmCallBack.class);
	public void returnedMessage(Message message, int code, String text, String exchange, String key) {
		// TODO Auto-generated method stub
		String correlationId = message.getMessageProperties().getCorrelationId();
		
		logger.info("消息：{} 发送失败, 应答码：{} 原因：{} 交换机: {}  路由键: {}", correlationId, code, text, exchange, key);
	}
}
